package DataAccess.Storage;

import java.io.Serializable;
import java.awt.Color;

import BackGround.BgLine;
/**
 * Title:        iPAD
 * Description:
 * Copyright:    Copyright (c) 2002
 * Company:      ABB Inc.
 * @author Fangxing Li
 * @version 1.0
 */

public class BgLineForStorage implements Serializable{
  public static final long serialVersionUID=100204L;

  protected String  sName;
  protected double  dFontSize;
  protected int     iThickness;
  protected int     iStyle;
  protected int     iColor;
  protected int     iX1Stored, iY1Stored, iX2Stored, iY2Stored;

  public BgLineForStorage() { }

  public void copyFromBgLine( BgLine bgLine ){
      this.sName = bgLine.getName();
      this.dFontSize = bgLine.getFontSize();
      this.iThickness = bgLine.getThickness();
      this.iStyle = bgLine.getStyle();
      this.iColor = bgLine.getColor().getRGB();
      this.iX1Stored = bgLine.getElemGeomObj().getX1Stored();
      this.iY1Stored = bgLine.getElemGeomObj().getY1Stored();
      this.iX2Stored = bgLine.getElemGeomObj().getX2Stored();
      this.iY2Stored = bgLine.getElemGeomObj().getY2Stored();
  }

  public BgLine createBgLineFromThis(){
      Color clr = new Color( iColor );
      return new BgLine( sName, dFontSize, iThickness, iStyle, clr,
                            iX1Stored, iY1Stored, iX2Stored, iY2Stored );
  }
}